package com.boot.plus.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.boot.plus.dao.UserDao;
import com.boot.plus.entity.User;
import com.boot.plus.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	
	//注入dao
	@Autowired
	private UserDao userDao;

	@Override
	public List<User> getAllUser() {
		return userDao.selectList(null);
	}

	@Override
	public int addUser(User user) {
		int effectedNum = userDao.insert(user);
		if(effectedNum > 0){
			return 1;
		}
		return 0;
	}
	
}
